import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 验证码识别
import ddddocr

# 显示等待，更加智能
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# 提供键盘按键的支持，比如：RETURN, F1, ALT等
from selenium.webdriver.common.keys import Keys

from utils import is_login, load_cookies, save_cookies

driver = webdriver.Firefox()
load_cookies(driver)

# 判断是否已经登录
# if is_login(driver) is False:
    
# else:
#     try:
#         element = WebDriverWait(driver, 10).until(
#             EC.presence_of_element_located((By.NAME, "menuIcon1"))
#         )
#         if element:
#             print("我已经成功等待")
#         else:
#             print("失败是我")
#     finally:
#         driver.quit()
#     print(666)
